const sab : SharedArrayBuffer = new SharedArrayBuffer (1024);
const ta : Uint8Array = new Uint8Array (sab);
ta [0];
ta [0] = 5;
var v1 : number = Atomics.add (ta, 0, 12);
console.log (v1);
console.log (typeof v1);
var v2 : number = Atomics.load (ta, 0);
console.log (v2);
console.log (typeof v2);
var v3 : number = Atomics.and (ta, 0, 1);
console.log (v3);
console.log (typeof v3);
v2 = Atomics.load (ta, 0);
var v4 : number = Atomics.compareExchange (ta, 0, 5, 12);
console.log (v4);
console.log (typeof v4);
v2 = Atomics.load (ta, 0);
var v5 : number = Atomics.exchange (ta, 0, 12);
console.log (v5);
console.log (typeof v5);
v2 = Atomics.load (ta, 0);
var v6 : boolean = Atomics.isLockFree (1);
console.log (v6);
console.log (typeof v6);
Atomics.isLockFree (2);
Atomics.isLockFree (3);
Atomics.isLockFree (4);
var v7 : number = Atomics.or (ta, 0, 1);
console.log (v7);
console.log (typeof v7);
v2 = Atomics.load (ta, 0);
var v8 : number = Atomics.store (ta, 0, 12);
console.log (v8);
console.log (typeof v8);
var v9 : number = Atomics.sub (ta, 0, 2);
console.log (v9);
console.log (typeof v9);
v2 = Atomics.load (ta, 0);
var v10 : number = Atomics.xor (ta, 0, 1);
console.log (v10);
console.log (typeof v10);
Atomics.load (ta, 0);
const int32 : Int32Array = new Int32Array (sab);
var v11 : string = Atomics.wait (int32, 0, 0);
console.log (v11);
console.log (typeof v11);
